package com.sophialex.health.record.perspective;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import com.sophialex.health.record.views.PersonBottomLeftView;
import com.sophialex.health.record.views.PersonBottomRightView;
import com.sophialex.health.record.views.PersonTopLeftView;
import com.sophialex.health.record.views.PersonTopRightView;
import com.sophialex.health.record.views.ServiceToDoView;
import com.sophialex.health.record.views.baseinfo.PersonBaseInfoView;
import com.sophialex.health.record.views.baseinfo.YearCheckView;
import com.sophialex.health.record.views.children.ChildRenRegisterView;
import com.sophialex.health.record.views.children.ChildrenCheckView;
import com.sophialex.health.record.views.children.InfantHealthView;
import com.sophialex.health.record.views.pregnant.AntenatalreView;
import com.sophialex.health.record.views.pregnant.Postpartum42DayCheckView;
import com.sophialex.health.record.views.pregnant.PostpartumView;
import com.sophialex.health.record.views.pregnant.PregnantRecordView;
import com.sophialex.health.record.views.visits.DiabetesVisitsView;
import com.sophialex.health.record.views.visits.HypertensionVisitView;
import com.sophialex.health.record.views.visits.SchizophreniaVisitsView;
import com.sophialex.health.record.views.visits.TuberculosisVisits1View;



public class PersonRecordPerspective implements IPerspectiveFactory {
	public static final String ID = "com.sophialex.health.record.perspective.PersonRecordPerspective";

	public void createInitialLayout(IPageLayout layout) {
		String editorArea = layout.getEditorArea();
		layout.setFixed(true);
		layout.addStandaloneView(PersonTopLeftView.ID,  false, IPageLayout.LEFT, 0.15f, editorArea);
		
		IFolderLayout mainLayout = layout.createFolder("persion.main", IPageLayout.LEFT, 0.83f, editorArea);
		mainLayout.addView(PersonBaseInfoView.ID);
		mainLayout.addPlaceholder(YearCheckView.ID);
		mainLayout.addPlaceholder(ChildRenRegisterView.ID);
		mainLayout.addPlaceholder(InfantHealthView.ID);
		mainLayout.addPlaceholder(ChildrenCheckView.ID);
		mainLayout.addPlaceholder(PregnantRecordView.ID);
		mainLayout.addPlaceholder(AntenatalreView.ID);
		mainLayout.addPlaceholder(PostpartumView.ID);
		mainLayout.addPlaceholder(Postpartum42DayCheckView.ID);
		
		mainLayout.addPlaceholder(DiabetesVisitsView.ID);
		mainLayout.addPlaceholder(SchizophreniaVisitsView.ID);
	
		mainLayout.addPlaceholder(HypertensionVisitView.ID);
		mainLayout.addPlaceholder(TuberculosisVisits1View.ID);
		
		layout.getViewLayout(PersonBaseInfoView.ID).setCloseable(false);
		layout.getViewLayout(YearCheckView.ID).setCloseable(false);
		layout.getViewLayout(ChildRenRegisterView.ID).setCloseable(false);
		layout.getViewLayout(InfantHealthView.ID).setCloseable(false);
		layout.getViewLayout(ChildrenCheckView.ID).setCloseable(false);
		layout.getViewLayout(AntenatalreView.ID).setCloseable(false);
		layout.getViewLayout(PostpartumView.ID).setCloseable(false);
		layout.getViewLayout(Postpartum42DayCheckView.ID).setCloseable(false);
		
		layout.getViewLayout(DiabetesVisitsView.ID).setCloseable(false);
		layout.getViewLayout(SchizophreniaVisitsView.ID).setCloseable(false);
		layout.getViewLayout(HypertensionVisitView.ID).setCloseable(false);
		layout.getViewLayout(TuberculosisVisits1View.ID).setCloseable(false);
		
		layout.addStandaloneView(PersonTopRightView.ID,  true, IPageLayout.LEFT, 0.15f, editorArea);
		layout.setEditorAreaVisible(false);
		layout.addStandaloneView(PersonBottomLeftView.ID,  true, IPageLayout.BOTTOM, 0.30f, PersonTopLeftView.ID);
		IFolderLayout rightLayout = layout.createFolder("persion.right", IPageLayout.BOTTOM, 0.30f, PersonTopRightView.ID);
		rightLayout.addView(PersonBottomRightView.ID);
		rightLayout.addView(ServiceToDoView.ID);
		
		
	}

}
